<ui:composition template="/template/template-professor.xhtml"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets">

    <ui:define name="corpo">
        <!--<p:panel style="font-size: 10px !important; margin-bottom: 5% !important;">
            Inserção dos dados -> <h:outputText style="color: #999999 !important;" value="Upload das fotos"/>
        </p:panel>-->
        <h:form id="pa">
            <div style="font-size: 13px !important; padding-bottom: 5% !important;">
		<p:panel style="">
		    <p:messages autoUpdate="true" id="mensagem" showDetail="true" />
                    <p:selectOneMenu id="filo" value="#{cadastraFitoManagedBean.filo}" height="150" style="margin-bottom: 5px !important; width: 120px !important;">
                        <f:selectItem itemLabel="Filo" itemValue="" itemDisabled="true"/>
                        <f:selectItems value="#{cadastraFitoManagedBean.listFilo}"/>
                        <p:ajax update="classe ordem familia genero especie Submit"
                                listener="#{cadastraFitoManagedBean.fetchAllClasses()}" />
                    </p:selectOneMenu>
                    <!--<p:commandButton icon="ui-icon-plus" style="font-size: 10px !important; float: right !important;" onclick="FiloDial.show()"/>-->
                    <br/>
                    <p:selectOneMenu id="classe" value="#{cadastraFitoManagedBean.classe}" height="150" style="margin-bottom: 5px !important; width: 120px !important;">
                        <f:selectItem itemLabel="Classe" itemValue="" itemDisabled="true"/>
                        <f:selectItems value="#{cadastraFitoManagedBean.listClasse}" />
                        <p:ajax update="ordem familia genero especie Submit"
                                listener="#{cadastraFitoManagedBean.fetchAllOrdens()}" />
                    </p:selectOneMenu>
                    <!--<p:commandButton icon="ui-icon-plus" style="font-size: 10px !important; float: right !important;"/>-->
                    <br/>
                    <p:selectOneMenu id="ordem" value="#{cadastraFitoManagedBean.ordem}" height="150" style="margin-bottom: 5px !important; width: 120px !important;">
                        <f:selectItem itemLabel="Ordem" itemValue="" itemDisabled="true"/>
                        <f:selectItems value="#{cadastraFitoManagedBean.listOrdem}" />
                        <p:ajax update="familia genero especie Submit"
                                listener="#{cadastraFitoManagedBean.fetchAllFamilias()}" />
                    </p:selectOneMenu>
                    <!--<p:commandButton icon="ui-icon-plus" style="font-size: 10px !important; float: right !important;"/>-->
                    <br/>
                    <p:selectOneMenu id="familia" value="#{cadastraFitoManagedBean.familia}" height="150" style="margin-bottom: 5px !important; width: 120px !important;">
                        <f:selectItem itemLabel="Familia" itemValue="" itemDisabled="true"/>
                        <f:selectItems value="#{cadastraFitoManagedBean.listFamilia}" />
                        <p:ajax update="genero especie Submit"
                                listener="#{cadastraFitoManagedBean.fetchAllGenero()}" />
                    </p:selectOneMenu>
                    <!--<p:commandButton icon="ui-icon-plus" style="font-size: 10px !important; float: right !important;"/>-->
                    <br/>
                    <p:selectOneMenu id="genero" value="#{cadastraFitoManagedBean.genero}" height="150" style="margin-bottom: 5px !important; width: 120px !important;">
                        <f:selectItem itemLabel="Genero" itemValue="" itemDisabled="true"/>
                        <f:selectItems value="#{cadastraFitoManagedBean.listGenero}" />
                        <p:ajax update="especie Submit"
                                listener="#{cadastraFitoManagedBean.fetchAllEspecie()}" />
                    </p:selectOneMenu>
                    <!--<p:commandButton icon="ui-icon-plus" style="font-size: 10px !important; float: right !important;"/>-->
                    <br/>
                    <p:selectOneMenu id="especie" value="#{cadastraFitoManagedBean.especie}" height="150" style="margin-bottom: 5px !important; width: 120px !important;">
                        <f:selectItem itemLabel="Especie" itemValue="" itemDisabled="true"/>
                        <f:selectItems value="#{cadastraFitoManagedBean.listEspecie}" />
                        <p:ajax update="Submit"
                                listener="#{cadastraFitoManagedBean.fetchAllFitolito()}"/>
                    </p:selectOneMenu>
                    <!--<p:commandButton icon="ui-icon-plus" style="font-size: 10px !important; float: right !important;"/>-->
                    <br/>

                    <p:separator />

                    <p:commandButton style="margin-bottom: 35px !important; margin-top: 20px !important;" value="Avançar" id="Submit" action="#{cadastraFitoManagedBean.findPlanta()}" />
                </p:panel>
            </div>

            <p:dialog id="filocad" widgetVar="FiloDial" header="Filo" resizable="false" style="font-size: 13px !important;">
                <div style="margin-top: 5px !important;">
                    <h:outputText value="Nome:" style="margin-right: 15px !important;"/>
                    <p:inputText value="#{cadastraFitoManagedBean.nfilo}"/>
                </div>
                <br/>
                <p:commandButton value="Cadastrar" update="filo" style="font-size: 12px !important;"/>
                <p:commandButton value="Cancelar" action="#{cadastraFitoManagedBean.cancelaFilo()}" onclick="FiloDial.hide()" style="font-size: 12px !important;"/>
            </p:dialog>

        </h:form>
    </ui:define>
</ui:composition>